
/*
*    MCreator note: This file will be REGENERATED on each build.
*/
package net.ddns.xcyyds.kungfu.init;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.village.VillagerTradesEvent;
import net.minecraftforge.common.BasicItemListing;

import net.minecraft.world.item.Items;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.npc.VillagerTrades;
import net.minecraft.world.entity.npc.VillagerProfession;

import java.util.List;

import it.unimi.dsi.fastutil.ints.Int2ObjectMap;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE)
public class KungFuModTrades {
	@SubscribeEvent
	public static void registerTrades(VillagerTradesEvent event) {
		Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades();
		if (event.getType() == VillagerProfession.LIBRARIAN) {
			trades.get(2).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_YIN.get(), 10),

					new ItemStack(KungFuModItems.L_LBOOK.get()), 1, 5, 0.05f));
			trades.get(2).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_YIN.get(), 10),

					new ItemStack(KungFuModItems.R_RBOOK.get()), 1, 5, 0.05f));
			trades.get(2).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_YIN.get(), 10),

					new ItemStack(KungFuModItems.L_RBOOK.get()), 1, 5, 0.05f));
			trades.get(2).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_YIN.get(), 10),

					new ItemStack(KungFuModItems.R_LBOOK.get()), 1, 5, 0.05f));
			trades.get(1).add(new BasicItemListing(new ItemStack(Items.BOOK, 5),

					new ItemStack(KungFuModItems.SUI_YIN.get()), 10, 2, 0.05f));
			trades.get(1).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_YIN.get(), 4),

					new ItemStack(KungFuModItems.NO_SUI_YIN.get()), 100, 0, 0f));
			trades.get(1).add(new BasicItemListing(new ItemStack(KungFuModItems.NO_SUI_YIN.get(), 4),

					new ItemStack(KungFuModItems.SUI_JIN.get()), 100, 0, 0f));
			trades.get(1).add(new BasicItemListing(new ItemStack(KungFuModItems.SUI_JIN.get(), 4),

					new ItemStack(KungFuModItems.NO_SUI_JIN.get()), 100, 0, 0f));
			trades.get(1).add(new BasicItemListing(new ItemStack(KungFuModItems.NO_SUI_JIN.get()),

					new ItemStack(KungFuModItems.SUI_YIN.get(), 19), 100, 0, 0f));
		}
	}
}
